The present invention relates to a method of reading data from, and writing data to, a memory, to a corresponding computer program product and to apparatus for reading data from, and writing data to, a memory, which apparatus may be implemented, for example, as a Field Programmable Gate Array (FPGA).
Many different devices use memory to store data. Typically, the memory used to store the data is random access memory (RAM), whose contents are accessed by specifying a memory address to read from or write to, with data subsequently being read from or written to that address. Retrieving a piece of data from RAM can be slow if the memory address at which the piece of data is stored is unknown, as the whole of the memory must be searched to retrieve the desired piece of data. Thus, RAM is unsuitable for certain devices in which data must be accessed quickly, for example computer networking devices such as routers.
In order to address this problem, content addressable memories (CAMs) have been developed. In a CAM a desired piece of data is supplied and the CAM searches its entire memory, returning a list of memory addresses at which the desired piece of data is located. This addresses the issue of slow access speed, as every instance of the desired piece of data can be identified in a single operation. However, CAMs are expensive and tend to be physically larger and have higher power consumption than RAMs of equivalent storage capacity.
Thus, a need exists for an inexpensive and physically small system which is able to read stored data from a memory quickly, and to write data to a memory quickly.